package com.example.games.mygame;

import com.example.games.core.CDirector;
import com.example.games.core.CScene;

public class SceneManage implements CDirector {

	private static SceneManage instanceManage;

	public static SceneManage getInstance() {
		if (instanceManage == null) {
			instanceManage = new SceneManage();
		}
		return instanceManage;
	}

	private CScene currentScene;

	public SceneManage() {

	}

	@Override
	public void changeScene(CScene oldScene, CScene newScene) {
		// TODO Auto-generated method stub
		currentScene = null;
		oldScene.dispose();
		currentScene = newScene;
	}

	@Override
	public CScene getRunningScene() {
		// TODO Auto-generated method stub
		return currentScene;
	}

	@Override
	public void pause() {
		// TODO Auto-generated method stub
		currentScene.pause();
	}

	@Override
	public void resume() {
		// TODO Auto-generated method stub
		currentScene.resume();
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub
		currentScene.dispose();
	}

	@Override
	public void setSecne(CScene scene) {
		// TODO Auto-generated method stub
		if (scene != null) {
			currentScene = scene;
		}
	}

}
